Add inversion from weighted#655
Conversation
* add monoid module * clean up * fix doctest * fix * wip * remove incorrect rule * add disjoint set tests and fix bug * lint * drop jax monoid defs * drop incorrect comment * add assert * reduce nondeterminism and add assertions * fix inconsistent stream numbering and missing constant factors
| ) | ||
|
|
||
|
|
||
| def match_reduce(term: Term) -> tuple | None: |
There was a problem hiding this comment.
This is a very strange function. Surely there's a more comprehensible way to write this, even if it ends up being more verbose.
There was a problem hiding this comment.
Agreed. Unfortunately, I'm not sure how to write this in a way that doesn't enumerate operations. The subclassing relation between operations is implicit, and we want to match all subclasses (and leave open the possibility that new ones could be created).
|
Note: the mapping of |
0daf135 to
1d38f0d
Compare
Depends on #653